<?php

 $con = mysqli_connect('localhost','root','123456','hua');
  $phonenum=$_GET['phonenum'];
  $sql = "SELECT * FROM `cart` where `phonenum`='$phonenum'";

  $res = mysqli_query($con,$sql);

  if (!$res) {
    die('error for mysql: ' . mysqli_error());
  }



while($row = $res->fetch_assoc()){
      $data[] = $row;
    };

  echo json_encode(array(
    "code" => 1,
    "message" => "获取商品信息成功",
    "detail" => $data
),JSON_UNESCAPED_UNICODE);

?>
